<%@ include file="/WEB-INF/jsp/header.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<h1><c:out value="${user.userName}"/> (<c:out value="${user.fullName}"/>)</h1>

<c:choose>
  	<c:when test="${empty galleries}">
  		<p>Uživatel dosud nevložil žádnou fotogalerii</p> 
  	</c:when>
  	<c:otherwise>
  		<table>
  		<c:forEach var="gallery" items="${galleries}">
  			<tr>
  				<td>
  					<img src="${pageContext.request.contextPath}/uploaded/${gallery.owner.userName}/${gallery.rootFolder}/preview.jpg" width="150" />
  				</td>
  				<td>
  					<a href="<spring:url value="/gallery/${gallery.id}" />">${gallery.name}</a>
  				</td>
  			
			</tr>
		</c:forEach>
		<table>
  	</c:otherwise>
</c:choose>

<%@ include file="/WEB-INF/jsp/footer.jsp" %>